<?php
$host = "localhost"; // Host name 
$username = "root"; // Mysql username 
$password = "vertrigo"; // Mysql password 
$db_name = "tdc"; // Database name 
$tbl_name = "staffs"; // Table name 
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
mysql_query("set charset UTF8");
// select record from mysql 
$sql = "SELECT * FROM $tbl_name";
$result = mysql_query($sql);

?>
<html>
    <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
    <body>
        <table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
            <tr>
                <td colspan="5" bgcolor="#FFFFFF"><strong>Delete data in students</strong> </td>
            </tr>

            <tr>
                <td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td>
                <td align="center" bgcolor="#FFFFFF"><strong>Name</strong></td>
               
                <td align="center" bgcolor="#FFFFFF">&nbsp;</td>
                <td align="center" bgcolor="#FFFFFF">&nbsp;</td>
            </tr>

            <?php
            while ($rows = mysql_fetch_array($result)) {
                ?>

                <tr>
                    <td bgcolor="#FFFFFF"><?php echo $rows['id']; ?></td>
                    <td bgcolor="#FFFFFF"><?php echo $rows['name']; ?></td>
                    <td bgcolor="#FFFFFF"><a href="delete_staffs.php?id=<?php echo $rows['id']; ?>">delete</a></td>
                    
                </tr>
                <?php
// close while loop 
            }
            ?>
        </table>
        
    </body>
</html>
<?php
// close connection; 
mysql_close();
?>